﻿<Grid x:Class="VeNET.UserControls.SelectionBorder"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="300" Width="300">
    <Grid.Resources>
        <RadialGradientBrush x:Key="Gradient">
            <GradientStop Color="White" Offset="0.3" />
            <GradientStop Color="LightBlue" Offset="1.0" />
        </RadialGradientBrush>
        <Style TargetType="Rectangle" x:Key="Corner">
            <Setter Property="Stroke" Value="#5D96D8" />
            <Setter Property="Width" Value="8" />
            <Setter Property="Height" Value="8" />
            <Setter Property="Fill" Value="{StaticResource Gradient}" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Fill" Value="LightBlue" />
                </Trigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="Rectangle" x:Key="RoundCorner" BasedOn="{StaticResource Corner}">
            <Setter Property="RadiusX" Value="50" />
            <Setter Property="RadiusY" Value="50" />
        </Style>
    </Grid.Resources>
    
    <Rectangle Name="border" Stroke="#5D96D8" StrokeDashOffset="5" Stretch="Fill" StrokeDashCap="Flat" />
    <Rectangle Name="corner1" Style="{StaticResource Corner}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="-4,-4,0,0" Cursor="SizeNWSE" />
    <Rectangle Name="corner2" Style="{StaticResource Corner}" VerticalAlignment="Bottom" HorizontalAlignment="Left" Margin="-4,0,0,-4" Cursor="SizeNESW" />
    <Rectangle Name="corner3" Style="{StaticResource Corner}" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,-4,-4,0" Cursor="SizeNESW" />
    <Rectangle Name="corner4" Style="{StaticResource Corner}" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,-4,-4" Cursor="SizeNWSE" />

    <Rectangle Name="corner5" Style="{StaticResource Corner}" VerticalAlignment="Top" HorizontalAlignment="center" Margin="0,-4,0,0" Cursor="SizeNS" />
    <Rectangle Name="corner6" Style="{StaticResource Corner}" VerticalAlignment="Bottom" HorizontalAlignment="center" Margin="0,0,0,-4" Cursor="SizeNS" />
    <Rectangle Name="corner7" Style="{StaticResource Corner}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="-4,0,0,0" Cursor="SizeWE" />
    <Rectangle Name="corner8" Style="{StaticResource Corner}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,-4,0" Cursor="SizeWE" />
</Grid>
